<%@page import="com.enterprise.daoImpl.NodeDaoImpl,com.enterprise.domain.*"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%@include file="Inc/Head.jsp" %>
<%-- <%@language=vbscript codepage=936 %>
<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<!-- #include file="Inc/Head.asp" -->
<%
dim sql,rsBigClass,rsSmallClass,ErrMsg
set rsBigClass=server.CreateObject("adodb.recordset")
rsBigClass.open "Select * From BigClass_New",conn,1,3
%>------------ --%>
<script language="JavaScript" type="text/JavaScript">
function checkBig()
{
  if (document.form1.BigClassName.value=="")
  {
    alert("大类名称不能为空！");
    document.form1.BigClassName.focus();
    return false;
  }
}
function checkSmall()
{
  if (document.form2.BigClassName.value=="")
  {
    alert("请先添加大类名称！");
	document.form1.BigClassName.focus();
	return false;
  }

  if (document.form2.SmallClassName.value=="")
  {
    alert("小类名称不能为空！");
	document.form2.SmallClassName.focus();
	return false;
  }
}
function ConfirmDelBig()
{
   if(confirm("确定要删除此大类吗？删除此大类同时将删除所包含的小类和该类下的所有新闻，并且不能恢复！"))
     return true;
   else
     return false;
	 
}

function ConfirmDelSmall()
{
   if(confirm("确定要删除此小类吗？删除此小类同时将删除该类下的所有新闻，并且不能恢复！"))
     return true;
   else
     return false;
	 
}
</script>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top"><table width="90" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td align="center" valign="top"><br> <a href="News_ClassAddBig.jsp"><strong><font color="#FF0000"><u>添加新闻一级分类</u></font></strong></a><br> 
            <br> 
            <table width="500" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
              <tr bgcolor="#A4B6D7"> 
                <td width="50%" height="30" align="center" bgcolor="#A4B6D7"><strong>栏目名称</strong></td>
                <td height="30" align="center"><strong>操作选项</strong></td>
              </tr>
              <%NodeDaoImpl nodeDaoImpl=new NodeDaoImpl();
              	List<Node> list=nodeDaoImpl.getNodes(-1);
					              
               %>
               <% if(list!=null&&list.size()>0)
               	{
               	
               		for(Node node:list)
               		
               		{
               			
               %>
              <tr bgcolor="#F2F8FF" class="tdbg"> 
                <td width="233" height="22"><img src="Image/tree_folder4.gif" width="15" height="15"><%=node.getClassName() %></td>
                <td align="right" style="padding-right:10"><a href="News_ClassAddSmall.jsp?parentId=<%=node.getId()%>"><font color="#FF0000">添加二级分类</font></a> 
                  | <a href="News_ClassModifyBig.jsp?id=<%=node.getId()%>">修改</a> 
                  | <a href="node-delete.action?id=<%=node.getId()%>" onClick="return ConfirmDelBig();">删除</a></td>
              </tr>
              <%
              	List<Node> childrenNodes=nodeDaoImpl.getNodes(node.getId());
              	if(childrenNodes!=null&&childrenNodes.size()>0)
              		{
              			for(Node children:childrenNodes){
               %>
              <tr bgcolor="#EAEAEA" class="tdbg"> 
                <td width="233" height="22">&nbsp;&nbsp;<img src="Image/tree_folder3.gif" width="15" height="15"><%=children.getClassName() %></td>
                <td align="right" style="padding-right:10"><a href="News_ClassModifySmall.jsp?id=<%=children.getId()%>">修改</a> 
                  | <a href="node-delete.action?id=<%=children.getId() %>" onClick="return ConfirmDelSmall();">删除</a></td>
              </tr>
              <%}
              } %>
       <%
             }}
              %>
            </table>
            <br> </td>
        </tr>
      </table>
       </td>
  </tr>
</table>

<%@include file="Inc/Foot.jsp" %>